{%extends '../tpl/blog-base.html'%}
{%block body%}
<div class="detail-content">
    <p>访问量：{{data.num}}</p>
    <h1>{{data.title}}</h1>
    {{data.detail|safe}}
</div>
<div class="comment-part">
<h3> 评论列表：</h3>
    <ul class="comment-list">
        {%for k in comment%}
        <li>
            <div class="comment-head">
                <span class="email">{{k.email}}</span><span class="ip">IP:{%if k.ip%}{{k.ip}}{%else%}未知{%endif%}</span>
            </div>
            <div class="comment-inner">
                {{k.content}}
            </div>
            <div class="comment-time">
               时间：{{k.addTime}}
            </div>
            {%if k.response.content%}
            <div class="comment-response">
                {{k.response.addTime}}  {{k.response.as}}回复： <span class="response-content">{{k.response.content}}</span>
            </div>
            {%endif%}
        </li>
        {%endfor%}
    </ul>
    <form class="comment" action="/add/comment" method="post">
        <div class="form-row">
            <div class="label">您的邮箱：</div>
            <input type="text" name="email" placeholder="请输入您的邮箱">
        </div>
        <div class="form-row">
            <div class="label">内容：</div>
            <textarea name="content" placeholder="请输入留言内容"></textarea>
        </div>
        <div class="form-row">
            <div class="clearfix">
                <div id="captcha">
                    <div id="text">
                        行为验证™ 安全组件加载中
                    </div>
                    <div id="wait" class="show">
                        <div class="loading">
                            <div class="loading-dot"></div>
                            <div class="loading-dot"></div>
                            <div class="loading-dot"></div>
                            <div class="loading-dot"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="clearfix">
                <button class="submit-comment">提交留言</button>
            </div>
        </div>
        <input type="hidden" name="id" value="{{data._id}}">
        <input type="hidden" name="title" value="{{data.title}}">
    </form>
</div>
<script src="https://www.geetest.com/demo/libs/gt.js"></script>
{%endblock%}
